package cn.tedu.charging.device.controller;

import cn.tedu.chaging.common.pojo.param.GunStatusUpdateParam;
import cn.tedu.chaging.common.web.JsonResult;
import cn.tedu.chaging.common.pojo.StationInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RequestMapping("/device")
@RestController
@Api(tags="站点相关接口")
public class StationController {
    @ApiOperation("获取站点信息")
    @GetMapping("/station/info/{gunId}")
    public JsonResult getStationInfo(@PathVariable("gunId") Integer gunId) {
        log.debug("获取场站信息-{}",gunId);
        StationInfoVO stationInfo = new StationInfoVO();
        stationInfo.setOperatorId(1);
        stationInfo.setStationId(1);
//        JsonResult jsonResult = new JsonResult();
//        jsonResult.setCode(2000);
//        jsonResult.setData(stationInfo);
        return JsonResult.ok(stationInfo);
    }

    @ApiOperation("更新枪的状态")
    @PostMapping("/station/gun/status/update")
    public JsonResult updateGunStatus(GunStatusUpdateParam gunStatusUpdateParam) {
        log.debug("更新枪的状态-{}",gunStatusUpdateParam);
        return JsonResult.ok(true);
    }
}
